package it.unitn.testbed.client;

import it.unitn.testbed.client.common.BriefTaskComponent;
import it.unitn.testbed.client.common.MoteConfig;

import java.util.Date;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
 * The client side stub for the RPC service.
 */
@RemoteServiceRelativePath("testbed")
public interface TestbedService extends RemoteService {
	/** Gets the testbed configuration, i.e. the available motes */
	MoteConfig[] getTestbedConfig();

	/**
	 * Get the task component of a task, i.e. the mapping binary image - motes
	 * to flash
	 */
	BriefTaskComponent[] getTaskComponents();

	/** Remove a task component from the current task */
	BriefTaskComponent[] removeTaskComponent(long id);

	/**
	 * Submits the current task for execution.
	 * 
	 * @param duration
	 *            The duration requested for the task.
	 * @return the date when the task has been scheduled.
	 */
	Date submitTask(int duration);

	/** Cleans the server side of temporary task data. */
	void newTask();
}
